package api;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * Created by gmwang on 2018/11/8
 */
public class StreamTest {
    public static void main(String[] args) {
        List<String> list3 = Arrays.asList("a", "b", "c", "d", "e","a");
        List<String> list4 = Arrays.asList("a", "b", "c", "d", "e","a","a");
        Character [] chars1 = {'a','b','c','d','r','f'};
        Stream<String> stream = list3.stream().sorted();
        char [] chars2 = {'a','b','c','d','r','f','h'};
        System.out.println(Arrays.toString(Arrays.stream(chars1).sorted().toArray()));
        Stream<String> stream4 = list4.stream().sorted();
        ;

        System.out.println(Arrays.toString(stream4.toArray()));
        //
        boolean flag = true;
        for (int i = 0; i < list3.size(); i++) {
            if(!list3.get(i).equals(list4.get(i))){
                flag = false;
                System.out.println("找到这个了");
            }
        }
        if(flag){
            System.out.println(list4.get(list4.size() - 1));
        }
    }
}
